package com.pctx.common.pojo;

import java.io.Serializable;
import java.util.List;

public class UserInfo implements Serializable{
    private static final long serialVersionUID = 1L;

    private Long uid;

    private String name;

    private String password;

    private String salt;//加密的盐

    private Byte state;//用户状态，0：创建用户；1：正常；2：用户被锁定了.

    private String username; //用户名

    /**
     * 用户-角色 1VN
     */
//    private List<SysRole> roles;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

//    public List<SysRole> getRoles() {
//        return roles;
//    }
//
//    public void setRoles(List<SysRole> roles) {
//        this.roles = roles;
//    }

    /**
     * 增强版的盐
     * @return
     */
    //为了密码的更安全. username+salt;
    public String getUserNameAndSalt() {
        return this.username+this.salt;
    }
}